/*
 *  RESTful DDS is a prototyping effort to demonstrate how DDS could be combined
 *  with HTTP clients, extending the realm of pub/sub distribution to true wide
 *  area networking.
 *
 *  Copyright (C) 2009 PrismTech Ltd.
 *  reinier.torenbeek@gmail.com
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License Version 3 dated 29 June 2007, as published by the
 *  Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with restful-dds; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

package org.opensplice.restful.service;

public class RESTfulDDSResponse {
    
    public static final int CODE_SUCCESS = 0;
    public static final int CODE_ERROR = 1;
    private static final int CODE_COUNT = 2;
    
    private static String[] resultName = new String[CODE_COUNT];
    static {
        resultName[0]     = new String("CODE_SUCCESS");
        resultName[1]     = new String("CODE_ERROR");
    }    

    public static String JSONResponse(int _resultKind, String _message) {
        RESTfulDDSResponseObject responseObject =
            new RESTfulDDSResponseObject(resultName[_resultKind], _message);
        return responseObject.toString();
    }
}
